import Vue from 'vue';
import VueRouter from 'vue-router';

import Goods from 'components/Goods/Goods';
import Ratings from 'components/Ratings/Ratings';
import Seller from 'components/Seller/Seller';
import Home from 'views/Home';
import Food from 'views/Food';

Vue.use(VueRouter);
const routes = [{
  'path': '/',
  'redirect': '/home'
}, {
  'path': '/home',
  'name': 'home',
  'component': Home,
  'redirect': '/home/goods',
  'children': [{
    'path': 'goods',
    'name': 'goods',
    'component': Goods
  }, {
    'path': 'ratings',
    'name': 'ratings',
    'component': Ratings
  }, {
    'path': 'seller',
    'name': 'seller',
    'component': Seller
  }]
}, {
  'path': '/food/:foodId',
  'name': 'food',
  'component': Food
}];
/* eslint-disable object-curly-newline */
const router = new VueRouter({
  'linkActiveClass': 'active',
  'exact': true,
  routes
});

export default router;
